import baseinfoApi from "@/serveapi/baseinfoApi";
const SETSYSINFO='SETSYSINFO';
const  SETHEARTRULE='SETHEARTRULE';
const base={
    state:{
        sysInfo:{},
        heartRule:{}
    },
    getters:{
        getSysInfo:state=>state.sysInfo,
        getHeartRule:state=>state.heartRule
    },
    mutations:{
        [SETSYSINFO](state,sysInfo){
            state.sysInfo=sysInfo;
        },
        [SETHEARTRULE](state,heartRule){
            state.heartRule=heartRule;
        }

    },
    actions:{
        async getBaseInfo({state,commit}){
            let data=await baseinfoApi.getBaseInfo();
            commit('SETSYSINFO',data)
        },
        async getRules({state,commit}){
            let data=await baseinfoApi.getHeartRule();
            commit('SETHEARTRULE',data);
        }
    }



}
export default base